import { useState, useEffect } from "react";
import { getChannelAPI } from "@/apis/airticle";

// 封装获取列表频道
function useChannel() {
  const [channelList, setChannelList] = useState([]);

  useEffect(() => {
    getChannelAPI().then((res) => {
      console.log("resChannel", res);
      setChannelList(res.data.channels);
    });
  }, []);

  return {
    channelList,
  };
}

export { useChannel };
